﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true" CodeFile="ListInvites.aspx.cs" Inherits="Manage_ListInvites" %>
<%@ Register Src="~/Manage/CmsMessageBox.ascx" TagPrefix="cms" TagName="MessageBox" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $('#SearchBar').width($('#Body table.List').width());

            
            $('#<%=DeleteInvite.ClientID %>').click(function () {
                //判断chkID选中的个数
                if (Cms_CkeckedCount('chkID') == 0) {
                    Cms_MessageBox("请选择将要删除的邀请信息。");
                    return false;
                } else {
                    return Cms_Confirm('确认删除当前选中的邀请信息吗？');
                }
            });
        });
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="body" Runat="Server">
    <cms:MessageBox id="MessageBox" runat="server" />
    <asp:HiddenField ID="CurrentPage" runat="server" Value="1" />
    <div id="SearchBar">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <td><asp:HyperLink ID="AddInvite" runat="server" NavigateUrl="~/Manage/EditInvite.aspx" SkinID="AddLink">发出邀请</asp:HyperLink></td>
                <td><asp:LinkButton ID="DeleteInvite" runat="server" Text="删除邀请" 
                        SkinID="DeleteButton" onclick="DeleteInvite_Click"></asp:LinkButton></td>
                <td><asp:TextBox ID="SearchCondition" runat="server" SkinID="SearchBox" /><asp:HiddenField ID="SearchConditionHidden" runat="server" /></td>
                <td><asp:Button ID="Search" runat="server" Text="查询" 
                        onclick="Search_Click"/></td>
            </tr>
        </table>
    </div>
    <div style="clear: both">
        <asp:Repeater ID="InvitesView" runat="server">
            <HeaderTemplate>
                <table class="List" cellspacing="1">
                    <tr class="header">
                        <th style="width:50px">操作</th>
                        <th style="width:200px">标题</th>
                        <th style="width:120px">发出时间</th>
                        <th style="width:150px">应邀情况</th>
                        <th style="width:80px">&nbsp;</th>
                    </tr>
            </HeaderTemplate>
            <AlternatingItemTemplate>
                <tr class="even">
                    <td align="center">
                        <input type="checkbox" name="chkID" value='<%#Eval("ID") %>' <%#Convert.ToBoolean(Eval("CanCheck"))?"":"disabled='disabled'"%>/>
                    </td>
                    <td align="center" style="width:200px">
                        <asp:HyperLink runat="server" NavigateUrl='<%#"./EditInvite.aspx?iid=" + Eval("ID")%>'><%#Eval("Title") %></asp:HyperLink>
                    </td>
                    <td align="center" style="width:120px"><%#string.Format("{0:yyyy-MM-dd HH:mm}",Eval("Time")) %></td>
                    <td align="center" style="width:150px"><%#Eval("Status") %></td>
                    <td align="center" style="width:80px">
                        <asp:LinkButton ID="LinkButton1" runat="server" OnCommand="RegisteTrain" CommandArgument='<%#Eval("ID") %>'>登记培训</asp:LinkButton>
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <ItemTemplate>
                <tr class="odd">
                    <td align="center">
                        <input type="checkbox" name="chkID" value='<%#Eval("ID") %>' <%#Convert.ToBoolean(Eval("CanCheck"))?"":"disabled='disabled'"%> />
                    </td>
                    <td align="center" style="width:200px">
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#"./EditInvite.aspx?iid=" + Eval("ID")%>'><%#Eval("Title") %></asp:HyperLink>
                    </td>
                    <td align="center" style="width:120px"><%#string.Format("{0:yyyy-MM-dd HH:mm}",Eval("Time")) %></td>
                    <td align="center" style="width:150px"><%#Eval("Status") %></td>
                    <td align="center" style="width:80px">
                        <asp:LinkButton ID="LinkButton1" runat="server" OnCommand="RegisteTrain" CommandArgument='<%#Eval("ID") %>'>登记培训</asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                <tr class="Footer">
                    <td colspan="5" align="center" valign="middle">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td>共 <%=pds.DataSourceCount %> 条记录</td>
                                <td><asp:LinkButton ID="FirstButton" runat="server" SkinID="FirstButton" OnCommand="ChangePage" CommandArgument="F">&nbsp;</asp:LinkButton></td>
                                <td><asp:LinkButton ID="PreviousButton" runat="server" SkinID="PreviousButton" OnCommand="ChangePage" CommandArgument="P">&nbsp;</asp:LinkButton></td>
                                <td>第 <%=pds.CurrentPageIndex+1 %> 页 / 共 <%=pds.PageCount %> 页</td>
                                <td><asp:LinkButton ID="NextButton" runat="server" SkinID="NextButton" OnCommand="ChangePage" CommandArgument="N">&nbsp;</asp:LinkButton></td>
                                <td><asp:LinkButton ID="LastButton" runat="server" SkinID="LastButton" OnCommand="ChangePage" CommandArgument="L">&nbsp;</asp:LinkButton></td>
                                <td><asp:TextBox ID="GotoPage" runat="server" Width="30px"></asp:TextBox></td>
                                <td><asp:LinkButton ID="GotoButton" runat="server" SkinID="GotoButton" OnCommand="ChangePage" CommandArgument="G">&nbsp;</asp:LinkButton></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
</asp:Content>

